<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<html>
  <head>
	  <base href="<%=basePath%>">
	  <META   HTTP-EQUIV=”Pragma”   CONTENT=”no-cache”>   
	  <META   HTTP-EQUIV=”Cache-Control”   CONTENT=”no-cache”>   
	  <META   HTTP-EQUIV=”Expires”   CONTENT=”0”>   
      <title>增加商品</title>
	  <link rel="stylesheet" type="text/css" href="css/styles.css" >
	  <script type="text/javascript" src="javascript/jquery.js" charset="gb2312"></script>
	  <script type="text/javascript" src="javascript/user.js" charset="gb2312"></script>
  	  <script type="text/javascript" src="javascript/date.js" charset="gb2312"></script>
  </head>

  <body class="main">
  <form action="allGood!doAdd.action" method="post" name="addform">
 
  		<span class="page_title">团购管理　&gt;　添加商品</span>
		<div class="button_bar">
			<input type="button" class="common_button" onclick="history.go(-1)" value="返回"/>
			<input type="button" class="common_button" onclick="add()" value="保存"/>
		</div>
		<table class="query_form_table" border="0" cellPadding="3" cellSpacing="0">
			<div>
				<tr>
					<th class="input_title">编号</th>
					<td class="input_content">
						<input type="text" name="good.goodId" value="${id}"/>	
					</td>
				</tr>		
			</div>
			<tr>
				<th class="input_title">商品名称</th>
				<td class="input_content">
					<input type="text" name="good.goodName" id="gNameId"/><span class="red_star">*</span>
					<span style="color:red;display:none" id="goodnameErrorId">aa</span>
				</td>
				<th class="input_title">商品特价</th>
				<td class="input_content">
					<input type="text" name="good.goodPrice"/>	
				</td>
			</tr>
			<tr>
				<th class="input_title">商品原价</th>
				<td class="input_content">
					<input type="text" name="good.goodOldprice"/>
				</td>
				<th class="input_title">商品折扣</th>
				<td class="input_content">
					<input type="text" name="good.goodDiscount"/>	
				</td>
			</tr>
			<tr>
				<th class="input_title">节省价钱</th>
				<td class="input_content">
					<input type="text" name="good.goodSave"/>
				</td>
				<th class="input_title">商品开始出售时间</th>
				<td class="input_content">
				<%--good.startTime--%>
					<input type="text" name="good.startTime" onfocus="CreateMonthView(this)" onblur="DeleteMonthView(this)"/>
				</td>
			</tr>
			<tr>
				<th class="input_title">商品结束出售时间</th>
				<td class="input_content">
					<%--good.endTime--%>
					<input type="text" name="good.endTime" onfocus="CreateMonthView(this)" onblur="DeleteMonthView(this)"/>
				</td>
				<th class="input_title">商品内容</th>
				<td class="input_content">
					good.goodInfo	
				</td>
			</tr>
			<tr>
				<th class="input_title">商品种类</th>
				<td class="input_content">
					<input type="text" name="good.goodkind"/>
				</td>
				<th class="input_title">商品图片</th>
				<td class="input_content">
					<%--good.goodUrl--%>
					<input type="file" name="good.goodUrl"/>
				</td>
			</tr>
		</table>
	  <script type="text/javascript">
	  	  var oGoodnameCtl = $("#gNameId");
	  	  var oGoodnameSpan = $("#goodnameErrorId");
	  	  oGoodnameCtl.blur(function(){
				if(oGoodnameCtl.val()==""){
					oGoodnameSpan.html("商品名称不能为空").show();
					return;
				}
			});
			oGoodnameCtl.keydown(function(){
				oGoodnameSpan.hide();
			});
	  </script>
	</form>
  </body>
</html>
<c:if test="${param.message == 0}">
<script>
alert("添加失败");
</script>
</c:if>
